<template>
  <div ref="chartRef" style="width: 600px;height:400px;" class="xx-container">
    leidatu
  </div>
</template>

<script>
import * as echarts from 'echarts/core'
import { TitleComponent, LegendComponent } from 'echarts/components'
import { RadarChart } from 'echarts/charts'
import { CanvasRenderer } from 'echarts/renderers'
echarts.use([TitleComponent, LegendComponent, RadarChart, CanvasRenderer])
export default {
  name: 'Radar',
  components: {},
  props: [],
  data() {
    return {}
  },
  computed: {},
  mounted() {
    var chartDom = this.$refs.chartRef
    var myChart = echarts.init(chartDom)
    var option

    option = {
      legend: {
        data: ['Allocated Budget', 'Actual Spending']
      },
      radar: {
        indicator: [
          { name: '销售', max: 6500 },
          { name: '个人', max: 16000 },
          { name: '技能', max: 30000 },
          { name: '贡献', max: 38000 },
          { name: '发展', max: 52000 },
          { name: '潜力', max: 25000 }
        ]
      },
      series: [
        {
          name: 'Budget vs spending',
          type: 'radar',
          data: [
            {
              value: [4200, 3000, 20000, 35000, 50000, 18000],
              name: 'Allocated Budget'
            },
            {
              value: [5000, 14000, 28000, 26000, 42000, 21000],
              name: 'Actual Spending'
            }
          ]
        }
      ]
    }
    option && myChart.setOption(option)
  },
  methods: {}
}
</script>

<style lang='less' scoped>
</style>
